home *** CD-ROM | disk | FTP | other *** search
- Path: news.magmacom.com!not-for-mail
- From: ezust@mag1.magmacom.com (Acme Instant Dehydrated Boulder Kit)
- Newsgroups: comp.lang.c++
- Subject: Is it OK to delete const *type pointers?
- Date: 29 Mar 1996 16:15:55 -0500
- Organization: Cloud-Zero, Canada
- Message-ID: <4jhjub$fpc@mag1.magmacom.com>
- NNTP-Posting-Host: mag1.magmacom.com
-
-
- Some compilers let me do this, others do not. What I would like to know is,
- what does Stroustrup think? I.e. is it written somewhere in the ARM (I checked
- but can't find it) or in the draft standard? If somoene could e-mail me a
- quote or a pointer to a place where I can read where it says such a thing
- should or should not be allowed, I would appreciate it!
-
- const int* array= new int[30];
- delete[] array;
-
- MSVC says "can not delete const*"
- Some versions of G++ also don't let me do this.
-
- Is deleting an object technically considered changing that object's value?
-
- --
- Alan Ezust "Just because I work for the federal
- Ottawa, Canada government doesn't mean I'm an expert
- ezust@magmacom.com on cockroaches" -Special Agent Fox Mulder
- http://www2.magmacom.com/~ezust
-